package exdate;

import java.lang.invoke.VarHandle;
import java.time.LocalDate;

/**
 * @author: knowno
 * @create: 2025-09-15 09:33
 * @Version 1.0
 **/
public class TestLocalDate {
    public static void main(String[] args) {
        //1 创建本地日期对象 LocalDate.now()
        LocalDate localDate = LocalDate.now();
        System.out.println(localDate);
        //获取年
        int year = localDate.getYear();
        System.out.println(year);
        //获取月
        int month = localDate.getMonthValue();
        System.out.println(month);
        //获取日
        int day = localDate.getDayOfMonth();
        System.out.println(day);

        //2 创建指定日期对象 LocalDate.of()
        LocalDate of = LocalDate.of(2025, 9, 15);
        System.out.println(of);
    }
}
